package com.haoran.springboot.demo;


import com.haoran.springboot.model.Dept;

import java.lang.reflect.Method;

public class CompartorImp   {
    public static void main(String[] args) {
       try{
           ClassLoader loader = Thread.currentThread().getContextClassLoader();
           Class clazz = loader.loadClass("com.haoran.springboot.model.Dept");
           Method setFail=clazz.getMethod("setFali1",String.class);
           Method getFail=clazz.getMethod("getFali1");
           Dept dept=new Dept();
           setFail.invoke(dept,"1919");
           System.out.println("dept:"+dept.getFali1());
           Object obj=getFail.invoke(dept);
           System.out.println("getdept:"+obj.toString());

       }catch (Exception e){
           System.out.println(e.getMessage());
       }
    }
}

